import { onMounted, onUnmounted } from 'vue';

export function useResize(callback) {
    const handleResize = (event) => {
        callback(event);
    };

    onMounted(() => {
        window.addEventListener('resize', handleResize);
    });

    onUnmounted(() => {
        window.removeEventListener('resize', handleResize);
    });
}
